<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>{:session('cp.cpsysname')}--商户管理平台</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
        <meta name="description" content="{:config('webconfig.description');}">
        <meta name="keywords" content="{:config('webconfig.keywords');}">
        <meta name="author" content="runoob">
        <link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrapSwitch.css">
        <link rel="stylesheet" href="__STATIC_URL__/static/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/index.css"/>
        <link rel="stylesheet" href="__PUBLIC__/Admin/css/addmchat.css"/>
        <script src="__STATIC_URL__/static/js/jquery-2.1.4.min.js"></script>
        <script src="__STATIC_URL__/static/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        <script src="__PUBLIC__/Admin/js/bootstrap-datetimepicker.js" type="text/javascript" charset="utf-8"></script>
        <script src="__PUBLIC__/Admin/js/liandong.js" type="text/javascript" charset="utf-8"></script>
        <script src="__PUBLIC__/Admin/js/commen.js" type="text/javascript" charset="utf-8"></script>
        <style>
            .filePicker{
                margin-top: -5px;
                width: 150px;
                height: 44px;
                background: #00A2D4;
                color: #fff;
                text-align: center;
                line-height: 44px;
                border-radius: 4px;
                cursor: pointer;
            }
            .file{
                position: absolute;
                left: 14px;
                top: -5px;
                width: 150px;
                height: 44px;
                line-height: 44px;
                opacity: 0;
                cursor: pointer;
            }
            .img-file{
                width: 100px;
                height: 100px;
                display: block;
                margin-left: 26px;
                margin-top: 10px;
                display: none;
            }
            .form-control{
                width: 50%;
            }
        </style>
    </head>
    <body onload="first()">
    <include file='Index/header'/>
    <!------------------导航-------------------------->
    <section>
        <include file='Index/left'/>
        <!--------------------------主要内容区域------------------------------------->
        <div class="content">
            <div class="page-heading">
                <ul class="breadcrumb">
                    <li>
                       当前位置是&nbsp;:&nbsp;微信卡券
                    </li>
                    <li class="active" style="color: #02b87f;"> 添加卡券</li>
                </ul>
            </div>
            <div class="panel mgr15 mgl15">
                <div class="panel-heading addCharts" style="background:#ededed;">
                    添加卡券
                </div>
                <div class="panel-body">
                    <div class="col-md-3">
                        <div class="">
                            <ul id="myTab" class="nav nav-pills nav-stacked" role="tablist">
                                <li role="presentation" class="active"><a href="#danz" role="tab" data-toggle="tab" aria-controls="danz">查看卡券详情</a></li>
                                <li role="presentation"><a href="#danl" role="tab" data-toggle="tab" aria-controls="danl">查看单张核销</a></li>
                                <li role="presentation"><a href="#deldan" role="tab" data-toggle="tab" aria-controls="deldan">删除单张</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="col-md-9">
                <div class="tab-content">
                    <!--查询单类-->
                    <div role="tabpanel" class="panel-body tab-pane active" id="danz" aria-labelledBy="danz-tab">
                        <form class="form-horizontal adminex-form" action='' method="post">
                            <input type="hidden" name="type" value="1" >
                          <div class="form-group">
                            <label class="col-sm-2 col-sm-2 control-label">卡券ID</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control col-sm-6 col-xs-7" name='card_id'>
                                <div class="error"></div>
                            </div>
                          </div>
                          <div style="text-align: center">
                            <button type="submit" class="btn btn-primary">查询</button>
                          </div>
                        </form>
                    </div>

                    <!--查询单张-->
                    <div role="tabpanel" class="panel-body tab-pane" id="danl" aria-labelledBy="danl-tab">
                        <form class="form-horizontal adminex-form" action='' method="post">
                            <input type="hidden" name="type" value="1" >
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">卡券ID</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control col-sm-6 col-xs-7" name='card_id'>
                                    <div class="error"></div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">卡券CODE</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control col-sm-6 col-xs-7" name='code'>
                                    <div class="error"></div>
                                </div>
                            </div>
                            <div style="text-align: center">
                                <button type="submit" class="btn btn-primary">查询</button>
                            </div>
                        </form>
                    </div>

                    <!--删除单类-->
                    <div role="tabpanel" class="panel-body tab-pane" id="deldan" aria-labelledBy="danz-tab">
                        <form class="form-horizontal adminex-form" action='' method="post">
                            <input type="hidden" name="type" value="2" >
                            <div class="form-group">
                                <label class="col-sm-2 col-sm-2 control-label">卡券ID</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control col-sm-6 col-xs-7" name='card_id'>
                                    <div class="error"></div>
                                </div>
                            </div>
                            <div style="text-align: center">
                                <button type="submit" class="btn btn-primary">删除</button>
                            </div>
                        </form>
                    </div>

                </div>

                    </div>
                </div>
            </div>
            <include file='Index/footer'/>
        </div>
    </section>
</body>
    <script src="__PUBLIC__/Admin/js/bootstrapSwitch.js"></script>
    <script src="__PUBLIC__/Admin/js/commen.js" type="text/javascript" charset="utf-8"></script>
    <script>
        $(function () {
            $('#myTab a:first').tab('show');
        });
    </script>
<script>
    function addform() {
        $('#addcards').submit();
    };
    $(function () {
        $('#end_time').datetimepicker({
            minView: "month", //选择日期后，不会再跳转去选择时分秒
            language: 'zh-CN',
            format: 'yyyy-mm-dd',
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: true,
        });
    });
</script>
<script type="text/javascript">
    function upload(file,typed) {
        var formData = new FormData();
        formData.append('file', $('#' + file)[0].files[0]);
        formData.append('other',file);

        $.ajax({
            url: "{:U('Upload/uploadfile')}",
            type: 'POST',
            cache: false,
            data: formData,
            processData: false,
            contentType: false,
        }).done(function (res) {
            $("." + file).attr("src", res.savapath).css("display", "block");
            $(".file-"+file).val(res.other);
            $("."+typed+"-"+file).val(res.other);
        }).fail(function (res) {
            alert("上传失败")
        });
    }
</script>


</html>
